# Python 2.6.4
# Project Euler, Problem 109
# Copyright 2010 Talha Zaman

d = [sum([0<i<21, 0<i<41 and i%2==0, 0<i<61 and i%3==0, i==25, i==50]) for i in range(61)]
td = [0]*121
for i in range(len(d)):
    for j in range(i, len(d)):
        if i==j: td[i+j] += [0, 1, 3, 6][d[i]]
        else: td[i+j] += d[i]*d[j]
total = 0
for n in range(1, 100):
    if (n<=40 and n%2==0) or n==50: total += 1
    total += sum(d[n-i] for i in range(2, 41, 2)+[50] if 0<n-i<len(d))
    total += sum(td[n-i] for i in range(2, 41, 2)+[50] if 0<n-i<len(td))
print total
